function addCv()
{
  var ajaxRequest;  // The variable that makes Ajax possible!
  
  try{
    // Opera 8.0+, Firefox, Safari
    ajaxRequest = new XMLHttpRequest();
  } catch (e){
    // Internet Explorer Browsers
    try{
      ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try{
        ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e){
        // Something went wrong
        alert("Your browser broke!");
        return false;
      }
    }
  }
  // Create a function that will receive data sent from the server
  ajaxRequest.onreadystatechange = function(){
    if(ajaxRequest.readyState == 4){
      window.scrollTo(0, 0);
      var ajaxDisplay = document.getElementById('addCvResponse');
      ajaxDisplay.innerHTML = ajaxRequest.responseText;
    }
  }
  var fname = document.getElementById('fname').value;
  var mname = document.getElementById('mname').value;
  var lname = document.getElementById('lname').value;
  var address = document.getElementById('address').value;
  var country = document.getElementById('country').value;
  var state = document.getElementById('state').value;
  var nationality = document.getElementById('nationality').value;
  var tel = document.getElementById('tel').value;
  var mobile = document.getElementById('mobile').value;
  var email = document.getElementById('email').value;
  var dob = document.getElementById('dob').value;
  var gender = document.getElementById('gender').value;
  var marital = document.getElementById('marital').value;
  var military = document.getElementById('military').value;
  var uniDegree = document.getElementById('uniDegree').value;
  var uni = document.getElementById('uni').value;
  var faculty = document.getElementById('faculty').value;
  var department = document.getElementById('department').value;
  var grade = document.getElementById('grade').value;
  var gYear = document.getElementById('gYear').value;
  var gProject = document.getElementById('gProject').value;
  var appJob = document.getElementById('appJob').value;
  gProject = gProject.replace(/\n\r?/g, '<br />');
  var jObjectives = document.getElementById('jObjectives').value;
  jObjectives = jObjectives.replace(/\n\r?/g, '<br />');
  var jField = document.getElementById('jField').value;
  jField = jField.replace(/\n\r?/g, '<br />');
  var tEmployer1 = document.getElementById('tEmployer1').value;
  var tFrom1 = document.getElementById('tFrom1').value;
  var tTo1 = document.getElementById('tTo1').value;
  var tProject1 = document.getElementById('tProject1').value;
  var tEmployer2 = document.getElementById('tEmployer2').value;
  var tFrom2 = document.getElementById('tFrom2').value;
  var tTo2 = document.getElementById('tTo2').value;
  var tProject2 = document.getElementById('tProject2').value;
  var tEmployer3 = document.getElementById('tEmployer3').value;
  var tFrom3 = document.getElementById('tFrom3').value;
  var tTo3 = document.getElementById('tTo3').value;
  var tProject3 = document.getElementById('tProject3').value;
  var eEmployer1 = document.getElementById('eEmployer1').value;
  var eFrom1 = document.getElementById('eFrom1').value;
  var eTo1 = document.getElementById('eTo1').value;
  var eProject1 = document.getElementById('eProject1').value;
  var eEmployer2 = document.getElementById('eEmployer2').value;
  var eFrom2 = document.getElementById('eFrom2').value;
  var eTo2 = document.getElementById('eTo2').value;
  var eProject2 = document.getElementById('eProject2').value;
  var eEmployer3 = document.getElementById('eEmployer3').value;
  var eFrom3 = document.getElementById('eFrom3').value;
  var eTo3 = document.getElementById('eTo3').value;
  var eProject3 = document.getElementById('eProject3').value;
  var cCourse = document.getElementById('cCourse').value;
  cCourse = cCourse.replace(/\n\r?/g, '<br />');
  var sComputer = document.getElementById('sComputer').value;
  sComputer = sComputer.replace(/\n\r?/g, '<br />');
  var sLanguage = document.getElementById('sLanguage').value;
  sLanguage = sLanguage.replace(/\n\r?/g, '<br />');
  var sPersonal = document.getElementById('sPersonal').value;
  sPersonal = sPersonal.replace(/\n\r?/g, '<br />');
  var references = document.getElementById('references').value;
  references = references.replace(/\n\r?/g, '<br />');

  var paraString = "?fname=" + fname + "&mname=" + mname + "&lname=" + lname + 
                    "&address=" + address + "&country=" + country + "&state=" + state + 
                    "&nationality=" + nationality + 
                    "&tel=" + tel + "&mobile=" + mobile + "&email=" + email + 
                    "&dob=" + dob + "&gender=" + gender + "&marital=" + marital + 
                    "&military=" + military + "&uniDegree=" + uniDegree + 
                    "&uni=" + uni + "&faculty=" + faculty + "&department=" + department + 
                    "&grade=" + grade + "&gYear=" + gYear + "&gProject=" + gProject + 
                    "&appJob" + appJob + 
                    "&jObjectives=" + jObjectives + "&jField=" + jField + 
                    "&tEmployer1=" + tEmployer1 + "&tFrom1=" + tFrom1 + 
                    "&tTo1=" + tTo1 + "&tProject1=" + tProject1 + 
                    "&tEmployer2=" + tEmployer2 + "&tFrom2=" + tFrom2 + 
                    "&tTo2=" + tTo2 + "&tProject2=" + tProject2 + 
                    "&tEmployer3=" + tEmployer3 + "&tFrom3=" + tFrom3 + 
                    "&tTo3=" + tTo3 + "&tProject3=" + tProject3 + 
                    "&eEmployer1=" + eEmployer1 + "&eFrom1=" + eFrom1 + 
                    "&eTo1=" + eTo1 + "&eProject1=" + eProject1 + 
                    "&eEmployer2=" + eEmployer2 + "&eFrom2=" + eFrom2 + 
                    "&eTo2=" + eTo2 + "&eProject2=" + eProject2 + 
                    "&eEmployer3=" + eEmployer3 + "&eFrom3=" + eFrom3 + 
                    "&eTo3=" + eTo3 + "&eProject3=" + eProject3 + 
                    "&cCourse=" + cCourse + 
                    "&sComputer=" + sComputer + "&sLanguage=" + sLanguage + 
                    "&sPersonal=" + sPersonal + "&references=" + references;

  ajaxRequest.open("GET", "getAddCv.php" + paraString, true);
  ajaxRequest.send(null); 
}

function searchCvs()
{
  var ajaxRequest;  // The variable that makes Ajax possible!
  
  try{
    // Opera 8.0+, Firefox, Safari
    ajaxRequest = new XMLHttpRequest();
  } catch (e){
    // Internet Explorer Browsers
    try{
      ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try{
        ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e){
        // Something went wrong
        alert("Your browser broke!");
        return false;
      }
    }
  }
  // Create a function that will receive data sent from the server
  ajaxRequest.onreadystatechange = function(){
    if(ajaxRequest.readyState == 4){
      window.scrollTo(0, 0);
      var ajaxDisplay = document.getElementById('searchCvResponse');
      ajaxDisplay.innerHTML = ajaxRequest.responseText;
    }
  }
  var sName = document.getElementById('sName').value;
  var sCity = document.getElementById('sCity').value;
  var sYear = document.getElementById('sYear').value;

  var paraString = "?name=" + sName + "&city=" + sCity + "&year=" + sYear;

  ajaxRequest.open("GET", "getSearchCv.php" + paraString, true);
  ajaxRequest.send(null); 
}